package com.dgshanger.sanhxiaofeisc.mvp.model

import com.dgshanger.sanhxiaofeisc.common.AppApi
import com.dgshanger.sanhxiaofeisc.entity.CommentDetailsEntity
import com.dgshanger.sanhxiaofeisc.mvp.contract.CommentDetailsContract
import com.xx.baseutilslibrary.network.rx.RxHelper
import com.xx.baseutilslibrary.network.rx.XxBaseHttpObserver

/**
 * Created by JacobHHH on 2018/4/20.
 */
class CommentDetailsModel : CommentDetailsContract.Model {

    override fun loadData(comment_id: String?, httpObserver: XxBaseHttpObserver<CommentDetailsEntity>?) {
        AppApi.Api().getCommentDetailsData(comment_id)
                .compose(RxHelper.io_main())
                .compose(RxHelper.start_finish(httpObserver))
                .subscribe(httpObserver)
    }
}